package org.lc.cmd.connect.impl.ws;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.lc.cmd.connect.ClientSession;
import org.lc.cmd.connect.CmdClient;
import org.lc.cmd.connect.CmdClientConfig;

/**
 * 基于websocket的客户端
 */
@RequiredArgsConstructor
public class WsClient implements CmdClient {
    @Getter
    private final String id;

    @Override
    public ClientSession createSession(String url) {
        return new WsSession(CmdClientConfig.defaultProvider.getNameFactory().createSessionId(this, url), url);
    }
}
